{% extends "base.html" %}

{% block title %}{{ object.title }}{% endblock %}

{% block content %}
    <h1>{{ module.title }}</h1>

    <div class="contents">
        <h3>章节列表</h3>
        <ul id="modules">
            {% for m in object.modules.all %}
                <li data-id="{{ m.id }}" {% if m == module %} class="selected"{% endif %}>
                    <a href="{% url 'student_course_detail_module' object.id m.id %}">
                        <span>章节{{ m.order|add:1 }}</span>
                        <br>
                        {{ m.title }}
                    </a>
                </li>
            {% empty %}
                <li>当前课程没有章节</li>
            {% endfor %}
        </ul>
    </div>
    <div class="module">
        {% for content in module.contents.all %}
            <h2>{{ content.item.title }}</h2>
            {{ item.render }}
        {% endfor %}
    </div>
{% endblock %}